﻿using System;
using System.Collections.Generic;
using System.Web;

using fastJSON;

namespace kindly
{
    public class JSONSimpleResult
    {
        protected string result;
       
        public string Result
        {
            get { return result; }
            set { result = value; }
        }

        public void WriteResponse()
        {
            string json = JSONString;
            HttpContext context = HttpContext.Current;
            context.Response.Clear();
            context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            context.Response.ContentType = "text/plain";
            context.Response.Write(json);            
        }

        public string JSONString
        { 
            get
            { 
                return JSON.Instance.ToJSON(this, false); 
            }
        }
    }
}